package com.pb.infra.oth.util;

import com.itextpdf.text.PageSize;
import com.itextpdf.text.Rectangle;

import java.io.OutputStream;
import java.util.List;
import java.util.Map;

/**
 * @auther: liaohaoyuan
 * @time: 2022/6/08 10:45
 * @description
 */
public class PDFBuilder {

    /**
     * 作者
     */
    private String author = "资金系统";
    /**
     * 标题
     */
    private String title = "资金系统生成文档";
    /**
     * 签名原因
     */
    private String reason="保密文档";
    /**
     * 签名地点
     */
    private String location = "中国";

    /**
     * 文档字体大小，页脚页眉最好和文本大小一致
     */
    private int presentFontSize = 12;

    /**
     * 文档页面大小，最好前面传入，否则默认为A4纸张
     */
    private Rectangle pageSize = PageSize.A4;

    //是否是纵向
    private boolean islengthways = true;

    private List<String> types;

    private List<Map<String, Object>> datas;

    public boolean isIslengthways() {
        return islengthways;
    }

    public List<String> getTypes() {
        return types;
    }

    public void setTypes(List<String> types) {
        this.types = types;
    }

    public List<Map<String, Object>> getDatas() {
        return datas;
    }

    public void setDatas(List<Map<String, Object>> datas) {
        this.datas = datas;
    }

    //输出流
    private OutputStream out =null;

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getPresentFontSize() {
        return presentFontSize;
    }

    public void setPresentFontSize(int presentFontSize) {
        this.presentFontSize = presentFontSize;
    }

    public Rectangle getPageSize() {
        return pageSize;
    }

    public void setPageSize(Rectangle pageSize) {
        this.pageSize = pageSize;
    }

    public boolean getIslengthways() {
        return islengthways;
    }

    public void setIslengthways(boolean islengthways) {
        this.islengthways = islengthways;
    }

    public OutputStream getOut() {
        return out;
    }

    public void setOut(OutputStream out) {
        this.out = out;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }
}
